<?php
declare(strict_types=1);

use Phinx\Migration\AbstractMigration;

final class AddColumnCreatedByUnReadInTaskWorkOrderTable extends AbstractMigration
{
    public function up()
    {
        $this->table('task_work_order')
            ->addColumn('created_by_unread', 'enum', ['values' => 'yes,no', 'default' => 'no', 'null' => false, 'comment' => '创建人是否有未读消息'])
            ->addColumn('receiver_unread', 'enum', ['values' => 'yes,no', 'default' => 'no', 'null' => false, 'comment' => '接收人是否有未读消息'])
            ->save();
    }

    public function down()
    {
        $this->table('task_work_order')
            ->removeColumn('created_by_unread')
            ->removeColumn('receiver_unread')
            ->save();
    }
}
